package com.xbongbong.saas.enums;

import com.xbongbong.i18n.util.I18nMessageUtil;
import com.xbongbong.paas.enums.FieldTypeEnum;
import com.xbongbong.pro.constant.BusinessConstant;
import lombok.Getter;

/**
 * @author 吴峰
 * @version v1.0
 * @date 2019/4/9 19:59
 * @since v1.0
 */
@Getter
public enum StockSearchConditionEnum {

    // ------------ 库存查询用到的条件 ---------------//
    // 仓库 10020 预警类型
    WAREHOUSE_ID(FieldTypeEnum.WAREHOUSE_ID.getType(), "warehouseId", "enum.stockSearchCondition.memo.warehouse_id", BusinessConstant.SELECT_WAREHOUSE),
    // 预警类型 10021
    WARNING_TYPE(10021, "warningType", "enum.stockSearchCondition.memo.warning_type", BusinessConstant.SELECT_WARNING_TYPE),
    // 保质状况： 10022
    GUARANTEE_STATUS(10022, "guaranteeStatus", "enum.stockSearchCondition.memo.guarantee_status", BusinessConstant.SELECT_GUARANTEE_STATUS),
    // 产品分类：10023
    CATEGORY_ID(FieldTypeEnum.CATEGORY_ID.getType(), "categoryId", "enum.stockSearchCondition.memo.category_id", "enum.stockSearchCondition.placeholder.category_id"),;

    private Integer type;

    private String alias;

    private String memo;

    private String placeholder;

    StockSearchConditionEnum(Integer type, String alias, String memo, String placeholder) {
        this.type = type;
        this.alias = alias;
        this.memo = memo;
        this.placeholder = placeholder;
    }

    public String getMemo() {
        return I18nMessageUtil.getMessage(memo);
    }

    public String getPlaceholder() {
        return I18nMessageUtil.getMessage(placeholder);
    }
}
